<style>
input{
 width:100px; border: 1px solid silver; padding: 1px;
}


.style1 {font-family: inherit}
</style>
<div class="easyui-layout" fit="true">
	<div region="center" border="false" style="overflow:auto;padding:5px;background:#fff;"> 
<? if($modul=='pemesanan_cabang'){?>
	<div id="tab_detail"  >
		<div title="Purchase Requisition" style="padding:10px;">
			<form  method="post" id="<?=$modul?>_form"  enctype="multipart/form-data" 
			url="<?=base_url()?>procurement/simpan/tbl_pemesanan_cabang">
					<input type='hidden' name='sts' value="<?=$sts?>" >
					<input type='hidden' name='id' value="<?=($sts=='edit' ? $data_header->id : '')?>" >
					<input type='hidden' name='flag_div' value="<?=$flag_div?>" >
					<fieldset>
						<legend>Permintaan Barang</legend>
						<table width="100%" border="0">
						  <tr>
							<td width="3%">&nbsp;</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Permintaan Barang </span></td>
							<td width="2%">:</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							 <span id="no_pemesananna"><?=$no_pesanan?></span>
								<input type='hidden' name='no_pemesanan' id="no_pemesanan" style="width:200px;" value="<?=$no_pesanan?>" />
							</span></td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Diajukan Oleh</span></td>
							<td width="2%">:</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							 <span id=""><?=$fullname?></span>
								
							</span></td>
						  </tr>
						   <tr>
							<td width="3%">&nbsp;</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Permintaan Barang</span></td>
							<td width="2%">:</td>
							<td >
							<?=($sts=='edit' ? $data_header->tgl_pemesanan : date('Y-m-d'))?></td>
							
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Dealer</span></td>
							<td width="2%">:</td>
							<td >
								<select id="id_dealer" name="id_dealer" style="width:200px; border: 1px solid silver; padding: 1px;">
									<option value="">--Pilih--</option>
									<? foreach($dealer as $v){?>
										<option value="<?=$v['id']?>" <? if($sts=='edit'){if($data_header->id_dealer==$v['id']) echo 'selected';}?>><?=$v['nama_dealer']?></option>
									<? }?>
								</select>
							</td>
						  </tr>
						  
						</table>

					</fieldset>
					<br />
					
					
					<fieldset>
						<legend>Data Barang	</legend>
						<table width="100%"  cellpadding="0" cellspacing="2">
						  		  
						  <tr>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">&nbsp;</td>
							<td width="24%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Total Qty</td>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">:</td>
							<td width="72%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								<span id="grand_total_<?=$modul?>"></span></td>
						  </tr>
				    </table><br />
						 <table width="100%" border="0" id="table-2">
						 	<thead>
							  <tr>
								<th width="250px;">Nama Barang&nbsp;</th>
								
								<th>Merk Barang&nbsp;</th>
								<th align="center">Qty&nbsp;</th>
								<th>Satuan&nbsp;</th>
								
								<th align="center">.::.</th>
							  </tr>
							  </thead>
							  
						<? if($sts=='add'){?>
						  <tr>
						    <td width="250px;" align="center">
								<input type="text"   id="kd_brg_<?=$modul?>_0" style="width:200px;" />
								<a id="get_dtbarang_<?=$modul?>_0" onClick="get_barang(0);" class="l-btn l-btn-plain" href="#">
								<span class="l-btn-left">
									<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
								</span>
								<input type='hidden' id='kode_barang_<?=$modul?>_0' name='id_barang[]'>&nbsp;								
							</a>
							</td>
							
							<td><span id="merk_na_<?=$modul?>_0"></span></td>
							<td align="center" width="150px;"><input type="text" name="qty[]" style="width:50px;"  class="angka" id="qty_<?=$modul?>_0" onkeyup="hitung_na(0)"  /></td>
							<td width="150px;" align="center"><span id="satuan_na_<?=$modul?>_0"></span></td>
						
							<td align="center" width="50px;"><a href="#"  class="add_row" ><img src="<?=base_url()?>assets/css/themes_easyui/icons/add.png" title="Tambah" /></a><input type='hidden' name='id_detil[]' value="" ><input type='hidden' name='sts_detil[]' value="add" ></td>
						  </tr>
						  
						  <? } else { $index=0; foreach($data_detil as $v){?>
						  <tr>
						    <td width="250px;" align="center">
								<input type="text"   id="kd_brg_<?=$modul?>_<?=$index?>" value="<?=$v['nama_barang']?>" style="width:200px;" />
								<a id="get_dtbarang_<?=$modul?>_<?=$index?>" onClick="get_barang(<?=$index?>);" class="l-btn l-btn-plain" href="#">
								<span class="l-btn-left">
									<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
								</span>
								<input type='hidden' id='kode_barang_<?=$modul?>_<?=$index?>' name='id_barang[]' value="<?=$v['tbl_master_barang_id']?>">&nbsp;								
							</a>
							</td>
						
							<td><span id="merk_na_<?=$modul?>_<?=$index?>"><?=$v['merek_barang']?></span></td>
							<td align="center" width="150px;">
								<? if($data_header->flag=='P'){?>
								<input type="text" name="qty[]" style="width:50px;"  class="angka" id="qty_<?=$modul?>_<?=$index?>" onkeyup="hitung_na(<?=$index?>)" value="<?=$v['qty']?>"  />
								<? }else{echo $v['qty'];} ?>
							</td>
							<td width="150px;" align="center"><span id="satuan_na_<?=$modul?>_<?=$index?>"><?=$v['satuan_barang']?></span></td>
							
							<td align="center" width="50px;"><a href="#"  class="add_row" ><img src="<?=base_url()?>assets/css/themes_easyui/icons/add.png" title="Tambah" /></a><input type='hidden' name='id_detil[]' value="<?=$v['id']?>" ><input type='hidden' name='sts_detil[]' value="edit" ></td>
						  </tr>
						  
						  <? $index++; }}?>
						  
						  
						</table>

						
					</fieldset>
					<div region="south" border="false" style="text-align:right;padding:5px 0;">
					<? if($sts!='add'){if($data_header->flag=='P'){?>
						<a id="btnSend_<?=$modul?>" class="easyui-linkbutton l-btn" iconcls="disk" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text disk" style="padding-left: 20px;"><? if($sts=='add'){?>Simpan<? }else{?>Update<? }?></span>
							</span>
						</a>
					<? }}else{?>
					
					<a id="btnSend_<?=$modul?>" class="easyui-linkbutton l-btn" iconcls="disk" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text disk" style="padding-left: 20px;">Simpan</span>
							</span>
						</a>
					<? }?>
						<a id="btnBatal_<?=$modul?>" class="easyui-linkbutton l-btn" onclick="$('#isi_na_<?=$modul?>').css('display','inline');
								$('#form_naa_<?=$modul?>').css('display','none');" iconcls="cancel" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text cancel" style="padding-left: 20px;">Batal</span>
							</span>
						</a>
					</div>
			  </form>
			 
			  
	  	</div>
		
		<div title="Purchase Order" style="padding:10px;">
		
		</div>
		<div title="Data Barang" style="padding:10px;">
		
		</div>
	</div>	
	
<? } if($modul=='pemesanan'){?>
	<div id="tab_detail"  >
		<div title="Purchase Requisition" style="padding:10px;">
			<form  method="post" id="<?=$modul?>_form"  enctype="multipart/form-data" 
			url="<?=base_url()?>procurement/simpan/tbl_pemesanan_supplier">
					<input type='hidden' name='sts' value="<?=$sts?>" >
					<input type='hidden' name='id' value="<?=($sts=='edit' ? $data_header->id : '')?>" >
					<input type='hidden' name='flag_div' value="<?=$flag_div?>" >
					<fieldset>
						<legend>Pemesanan Pembelian Barang</legend>
						<table width="100%" border="0" style='border-collapse:collapse;'>
						  <tr>
							<td width="3%">&nbsp;</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Permintaan Barang </span></td>
							<td width="2%">:</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							 <span id="no_pemesananna"><input type='hidden' name='tbl_pemesanan_cabang_id' value="<?=$data_cab->id?>" ><?=$data_cab->no_pemesanan?></span>
								
							</span></td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Diajukan Oleh</span></td>
							<td width="2%">:</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							 <span id=""><?=$data_cab->create_by?></span>
								
							</span></td>
						  </tr>
						  
						  <tr >
							<td width="3%">&nbsp;</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl Permintaan Barang </span></td>
							<td width="2%">:</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							 <span id="no_pemesananna"><?=$data_cab->tgl_pemesanan?></span>
								
							</span></td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Dealer</span></td>
							<td width="2%">:</td>
							<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							 <span id=""><?=$data_cab->nama_dealer?></span>
								
							</span></td>
						  </tr>
						  <tr style="border-bottom:2px solid;">
							<td width="3%">&nbsp;</td>
							<td ></td>
							<td width="2%"></td>
							<td ></td>
							<td ></td>
							<td width="2%"></td>
							<td ></td>
						  </tr>
						 
				
							  <tr>
								<td width="3%">&nbsp;</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Pemesanan Barang </span></td>
								<td width="2%">:</td>
								<td ><span id="no_pemesananna"><?=$no_pesanan?></span>
								<input type='hidden' name='no_pemesanan' id="no_pemesanan" style="width:200px;" value="<?=$no_pesanan?>" /></td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Supplier</span></td>
								<td width="2%">:</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								 <input type="text" readonly id="nama_supplier_<?=$modul?>" value="<?=($sts=='edit' ? $data_header->nama_supplier : '')?>" style="width:250px;" />&nbsp;
									<a id="get_supplier_<?=$modul?>" class="l-btn l-btn-plain" href="#">
										<span class="l-btn-left">
											<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>
										</span>
									</a>
									<input type='hidden'  id='kode_supplier_<?=$modul?>' name='kode_supplier' value="<?=($sts=='edit' ? $data_header->kode_supplier : '')?>">
									
								</span></td>
							  </tr>
							  <tr>
								<td width="3%">&nbsp;</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl Pemesanan Barang </span></td>
								<td width="2%">:</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								
								<?=($sts=='edit' ? $data_header->tgl_pemesanan : date('Y-m-d'))?>
								</span></td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Pemesanan VIA </span></td>
								<td width="2%">:</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								 <select id="pemesanan_via" name="pemesanan_via" style="width:100px; border: 1px solid silver; padding: 1px;">
									<option value="">-- Pilih --</option>
									<option value="Fax" <? if($sts=='edit'){if($data_header->pemesanan_via=='Fax'){echo 'selected';}}?>>Fax</option>
									<option value="Email" <? if($sts=='edit'){if($data_header->pemesanan_via=='Email'){echo 'selected';}}?>>Email</option>
									<option value="Telepon" <? if($sts=='edit'){if($data_header->pemesanan_via=='Telepon'){echo 'selected';}}?>>Telepon</option>
								</select>	
									
								</span></td>
							  </tr>
							  <tr>
								<td width="3%">&nbsp;</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;"> Sistem Pengiriman Barang</span></td>
								<td width="2%">:</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								  <select id="sistem_pengiriman" name="sistem_pengiriman" style="width:250px; border: 1px solid silver; padding: 1px;"> 
									<option value="">-- Pilih --</option>
									<option value="Darat" <? if($sts=='edit'){if($data_header->sistem_pengiriman=='Darat'){echo 'selected';}}?>>Darat</option>
									<option value="Laut" <? if($sts=='edit'){if($data_header->sistem_pengiriman=='Laut'){echo 'selected';}}?>>Laut</option>
									<option value="Udara" <? if($sts=='edit'){if($data_header->sistem_pengiriman=='Udara'){echo 'selected';}}?>>Udara</option>
							</select>
								</span></td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;"> </span></td>
								<td width="2%">:</td>
								<td ><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								 
									
								</span></td>
							  </tr>
							  
							 
							</table>
					</fieldset>
					<br />
					
					
					<fieldset>
						<legend>Data Barang	</legend>
						<table width="100%"  cellpadding="0" cellspacing="2">
						  <tr>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">&nbsp;</td>
							<td width="24%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">PPN. Pembelian</td>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">:</td>
							<td width="72%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							    <input type="radio" name="sts_PPN" value="1" style="width:20px;"<? if ($sts=='edit'){if($data_detil[0]['sts_PPN']==1){ echo 'checked'; }}?>  />&nbsp;Include&nbsp;
								<input type="radio" name="sts_PPN" value="2" style="width:20px;" <? if ($sts=='edit'){if($data_detil[0]['sts_PPN']==2){ echo 'checked'; }}?> />Exclude
						    </td>
						  </tr>
						  
						  
						  <tr>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">&nbsp;</td>
							<td width="24%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Grand Total</td>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">:</td>
							<td width="72%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								Rp. <span id="grand_total_<?=$modul?>"></span>
									
							</td>
						  </tr>
				    </table><br />
					
					<? if($sts=='add'){?>
					<table width="100%" border="0" id="table-2">
						 	<thead>
							  <tr>
								<th width="350px;">Nama Barang&nbsp;</th>
								<th align="center" width="80px;">Qty Permintaan&nbsp;</th>
								<th align="center" width="80px;">Qty Pemesanan&nbsp;</th>
								<th width="50px;">Satuan&nbsp;</th>
								<th>Harga Satuan&nbsp;</th>
								<th>Tot. Harga&nbsp;</th>
								<!--th>DPP&nbsp;</th-->
								<th>Nominal PPN&nbsp;</th>
								<th>Harga + PPN&nbsp;</th>
								
							  </tr>
							  </thead>
							  <? $idx=0;foreach ($detil_pemesanan_cabang as $v){?>
							  <tr>
								<td width="350px;" align="left">
									<input type='hidden' name='id_barang[]' style="width:200px;" value="<?=$v['tbl_master_barang_id']?>" />
									<?=$v['nama_barang']?>
								</td>
								<td align="right" width="80px;">
									<input type='hidden' name='qty_cabang[]' value="<?=$v['qty']?>" >
									<?=number_format($v['qty'],2)?>
								</td>
								<td align="center" width="80px;"><input type="text" name="qty[]" style="width:50px;"  class="" id="qty_<?=$modul?>_<?=$idx?>" onkeyup="hitung_na(<?=$idx?>);" value=""></td>
								<td width="50px;" align="center"><?=$v['satuan_barang']?></td>
								<td align="right" >
									<span id="harga_na_<?=$modul?>_<?=$idx?>" style="display:none;">
										<?=$v['nominal_harga']?>
									</span>
									<?=number_format($v['nominal_harga'],2)?></td>
								<td align="right" >
									<span id="tot_harga_na_<?=$modul?>_<?=$idx?>" ></span>
								</td>
								<!--th align="right"><?=$v['dpp']?></th-->
								<td align="right">
									<span id="ppn_na_<?=$modul?>_<?=$idx?>" style="display:none;">
										<?=$v['ppn']?>
									</span>
									<?=number_format($v['ppn'],2)?>
								</td>
								<td align="right">
									<span id="harga_ppn_<?=$modul?>_<?=$idx?>" class="tot_na_<?=$modul?>" val="0"></span>
									<input type='hidden' name='id_detil[]' value="" >
									<input type='hidden' name='sts_detil[]' value="add" >
								</td>
								
							  </tr>
							  <? $idx++; }?>
						</table>
						 <? } else { ?>
						 <table width="100%" border="0" id="table-2">
						 	<thead>
							  <tr>
								<th width="350px;">Nama Barang&nbsp;</th>
								<th align="center" width="80px;">Qty Permintaan&nbsp;</th>
								<th align="center" width="80px;">Qty Pemesanan&nbsp;</th>
								<th width="50px;">Satuan&nbsp;</th>
								<th>Harga Satuan&nbsp;</th>
								<th>Tot. Harga&nbsp;</th>
								<!--th>DPP&nbsp;</th-->
								<th>Nominal PPN&nbsp;</th>
								<th>Harga + PPN&nbsp;</th>
								
							  </tr>
							  </thead>
							  <? $idx=0;foreach ($data_detil as $v){?>
							  <tr>
								<td width="350px;" align="left">
									<input type='hidden' name='id_barang[]' style="width:200px;" value="<?=$v['tbl_master_barang_id']?>" />
									<?=$v['nama_barang']?>
								</td>
								<td align="right" width="80px;">
									<input type='hidden' name='qty_cabang[]' value="<?=$v['qty_cabang']?>" >
									<?=number_format($v['qty_cabang'],2)?>
								</td>
								<td align="center" width="80px;"><input type="text" name="qty[]" style="width:50px;"  class="" id="qty_<?=$modul?>_<?=$idx?>" onkeyup="hitung_na(<?=$idx?>)" value="<?=$v['qty']?>"></td>
								<td width="50px;" align="center"><?=$v['satuan_barang']?></td>
								<td align="right" >
									<span id="harga_na_<?=$modul?>_<?=$idx?>" style="display:none;">
										<?=$v['nominal_harga']?>
									</span>
									<?=number_format($v['nominal_harga'],2)?></td>
								<td align="right" >
									<span id="tot_harga_na_<?=$modul?>_<?=$idx?>" ><?=number_format($v['tot_harga'],2)?></span>
								</td>
								<!--th align="right"><?=$v['dpp']?></th-->
								<td align="right">
									<span id="ppn_na_<?=$modul?>_<?=$idx?>" style="display:none;">
										<?=$v['ppn']?>
									</span>
									<?=number_format($v['ppn'],2)?>
								</td>
								<td align="right">
									<span id="harga_ppn_<?=$modul?>_<?=$idx?>" class="tot_na_<?=$modul?>" val="<?=$v['tot_ppn']?>"><?=number_format($v['tot_ppn'],2)?></span>
									
									
									<input type='hidden' name='id_detil[]' value="<?=$v['id']?>" >
									<input type='hidden' name='sts_detil[]' value="edit" >
								</td>
								
							  </tr>
							  <? $idx++; }?>
						</table>
						
						 <? }?>  
						  
				

						
					</fieldset>
					<div region="south" border="false" style="text-align:right;padding:5px 0;">
						<a id="btnSend_<?=$modul?>" class="easyui-linkbutton l-btn" iconcls="disk" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text disk" style="padding-left: 20px;"><? if($sts=='add'){?>Simpan<? }else{?>Update<? }?></span>
							</span>
						</a>
						<a id="btnBatal_<?=$modul?>" class="easyui-linkbutton l-btn" onclick="$('#isi_na_<?=$modul?>').css('display','inline');
								$('#form_naa_<?=$modul?>').css('display','none');" iconcls="cancel" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text cancel" style="padding-left: 20px;">Batal</span>
							</span>
						</a>
					</div>
			  </form>
			 
			  
	  	</div>
		
		<div title="Purchase Order" style="padding:10px;">
		
		</div>
		<div title="Data Barang" style="padding:10px;">
		
		</div>
	</div>	
	<? }
	if($modul=='pembelian'){
	?>
		<form  method="post" id="<?=$modul?>_form"  enctype="multipart/form-data" 
			url="<?=base_url()?>procurement/simpan/tbl_faktur_pembelian">
					<input type='hidden' name='sts' value="<?=$sts?>" >
					<input type='hidden' name='id' value="<?=($sts=='edit' ? $data_header->id : '')?>" >
					<input type='hidden' name='id_bayar' value="<?=($sts=='edit' ? $data_header->id_pembayaran : '')?>" >
					<input type='hidden' name='flag_div' value="<?=$flag_div?>" >
					<fieldset>
						<legend>Faktur Pembelian</legend>
						<table width="100%" border="0">
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Faktur Pembelian </span></td>
							<td width="2%">:</td>
							<td width="28%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							  <input type='text' name='no_faktur_pembelian' id="no_faktur_pembelian" style="width:200px;" value="<?=($sts=='edit' ? $data_header->no_faktur_pembelian : '')?>" length="10">
							</span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Pesanan Pembelian</span></td>
						    <td width="2%">:</td>
						    <td width="22%">
							<? if($sts=='add'){?>
							<input type="text" readonly id="no_pemesanan_<?=$modul?>" value="<?=($sts=='edit' ? $data_header->no_pemesanan : '')?>" />&nbsp;
								<a id="get_no_pemesanan_<?=$modul?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>									</span>								</a>
							<input type='hidden' id='tbl_master_pemesananbarang_id_<?=$modul?>' name='tbl_pemesanan_supplier_id' value="<?=($sts=='edit' ? $data_header->tbl_pemesanan_supplier_id : '')?>">		
							<? }else{?>
							<input type='hidden' id='tbl_master_pemesananbarang_id_<?=$modul?>' name='tbl_pemesanan_supplier_id' value="<?=($sts=='edit' ? $data_header->tbl_pemesanan_supplier_id : '')?>">	
							<?=($sts=='edit' ? $data_header->no_pemesanan : '')?>
							<?}?>
							&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Faktur</span></td>
							<td width="2%">:</td>
							<td width="28%"><input type="hidden" name="tgl_faktur"  value="<?=($sts=='edit' ? $data_header->tgl_faktur : date('Y-m-d'))?>"/>
							<?=($sts=='edit' ? $data_header->tgl_faktur : date('Y-m-d'))?></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Pesanan</span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="tgl_pesanan_<?=$modul?>"><?=($sts=='edit' ? $data_header->tgl_permintaan : '')?></span>&nbsp;</td>
					      </tr>
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Group Dealer</span></td>
							<td width="2%">:</td>
							<td width="28%"><span id="group_<?=$modul?>"><?=($sts=='edit' ? $data_header->nama_group_dealer : '')?></span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Permintaan</span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="no_permintaan_<?=$modul?>"><?=($sts=='edit' ? $data_header->no_permintaan : '')?></span>&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Dealer</span></td>
							<td width="2%">:</td>
							<td width="28%"><span id="dealer_<?=$modul?>"><?=($sts=='edit' ? $data_header->nama_dealer : '')?></span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Permintaan</span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="tgl_permintaan_<?=$modul?>"><?=($sts=='edit' ? $data_header->tgl_permintaan : '')?></span>&nbsp;</td>
					      </tr>
						 
						</table>

					</fieldset>
					
					<div id="detil_na_coy" style="overflow:auto; ">
						<fieldset>
							<legend>Pembayaran</legend>
								<table width="100%" border="0">
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Jenis Pembelian  </span></td>
							<td width="2%">:</td>
							<td width="28%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							  	<select id="jenis_pembelian" name="jenis_pembelian" style="width:100px; border: 1px solid silver; padding: 1px;">
									<option value="">-- Pilih --</option>
									<option value="Tunai" <? if($sts=='edit'){if($data_header->jenis_pembelian=='Tunai')echo 'selected';}?>>Tunai</option>
									<option value="Kredit" <? if($sts=='edit'){if($data_header->jenis_pembelian=='Kredit')echo 'selected';}?>>Kredit</option>
								</select>
							</span></td>
						    <td width="23%">
								<a id="btnHit_<?=$modul?>" class="easyui-linkbutton l-btn" iconcls="calculator" plain="true" href="#">
								<span class="l-btn-left">
									<span class="l-btn-text disk" style="padding-left: 20px;">Hitung</span>
								</span>
							</a>
							&nbsp;</td>
						    <td width="2%">&nbsp;</td>
						    <td width="22%">&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Jenis Pembayaran </span></td>
							<td width="2%">:</td>
							<td width="28%">
								<select id="jenis_pembayaran" name="jenis_pembayaran" style="width:150px; border: 1px solid silver; padding: 1px;">						
									<option value="">-- Pilih --</option>
									<option value="Di Depan" <? if($sts=='edit'){if($data_header->jenis_pembayaran=='Di Depan')echo 'selected';}?>>Di Depan</option>
									<option value="Di Belakang" <? if($sts=='edit'){if($data_header->jenis_pembayaran=='Di Belakang')echo 'selected';}?>>Di Belakang</option>
								</select></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Total Nilai faktur </span></td>
						    <td width="2%">:</td>
						    <td width="22%"><input type="hidden" name="tot_nilai_faktur" id="tot_nilai_faktur" value="<?=($sts=='edit' ? $data_header->tot_nilai_faktur : '')?>" />Rp .<span id="nilai_faktur_<?=$modul?>"><?=($sts=='edit' ? $data_header->tot_nilai_faktur : '')?></span>&nbsp;</td>
					      </tr>
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Cara Pembayaran </span></td>
							<td width="2%">:</td>
							<td width="28%">
								<select id="cara_pembayaran" name="cara_pembayaran" style="width:150px; border: 1px solid silver; padding: 1px;">
									<option value="">-- Pilih --</option>
									<option value="Cash" <? if($sts=='edit'){if($data_header->cara_pembayaran=='Cash')echo 'selected';}?>>Cash</option>
									<option value="Cheque Tunai" <? if($sts=='edit'){if($data_header->cara_pembayaran=='Cheque Tunai')echo 'selected';}?>>Cheque Tunai</option>
									<option value="Bilyet Giro" <? if($sts=='edit'){if($data_header->cara_pembayaran=='Bilyet Giro')echo 'selected';}?>>Bilyet Giro</option>
								</select></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Potongan Pembelian </span></td>
						    <td width="2%">:</td>
						    <td width="22%">Rp. <input type="text" name="potongan" id="potongan" value="<?=($sts=='edit' ? $data_header->potongan : '')?>" />&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Jatuh Tempo Termin 1 </span></td>
							<td width="2%">:</td>
							<td width="28%"><input type="text" name="termin_1" id="termin_1" value="<?=($sts=='edit' ? $data_header->termin_1 : '')?>" /></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Sub Total Pembelian </span></td>
						    <td width="2%">:</td>
						    <td width="22%">Rp. <span id="sub_tot_<?=$modul?>"></span>&nbsp;</td>
					      </tr>
						   <tr>
						     <td>&nbsp;</td>
						     <td><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Jatuh Tempo Termin 2 </span></td>
						     <td>:</td>
						     <td><input type="text" name="termin_2" id="termin_2" value="<?=($sts=='edit' ? $data_header->termin_2 : '')?>" /></td>
						     <td>Dpp</td>
						     <td>:</td>
						     <td><input type="text" name="dpp" id="dpp" value="<?=($sts=='edit' ? $data_header->dpp : '')?>" /></td>
						     </tr>
						   <tr>
						     <td>&nbsp;</td>
						     <td><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Jatuh Tempo Termin 3 </span></td>
						     <td>:</td>
						     <td><input type="text" name="termin_3" id="termin_3" value="<?=($sts=='edit' ? $data_header->termin_3 : '')?>" /></td>
						     <td>Nilai PPN </td>
						     <td>:</td>
						     <td>Rp. <span id="ppn_<?=$modul?>"></span></td>
						     </tr>
						   <tr>
						     <td>&nbsp;</td>
						     <td>Keterangan</td>
						     <td>:</td>
						     <td><textarea name="keterangan" id="keterangan" ><?=($sts=='edit' ? $data_header->keterangan : '')?></textarea></td>
						     <td>Pembelian Setelah PPN </td>
						     <td>:</td>
						     <td>Rp. <span id="tot_ppn<?=$modul?>"></span></td>
						     </tr>
						</table>
						</fieldset>
						
						<fieldset>
						<legend>Data Barang	</legend>
						<table width="100%"  cellpadding="0" cellspacing="2">
						 
						  <tr>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">&nbsp;</td>
							<td width="24%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Grand Total</td>
							<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">:</td>
							<td width="72%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
								Rp. <span id="grand_total_<?=$modul?>"><?=($sts=='edit' ? $data_header->tot_nilai_faktur : '')?></span></td>
						  </tr>
				    </table><br />
						<div id="table_na"><? if($sts=='edit') echo $data_barang;?></div>
						
						
					</fieldset>
						
						
						
						
					
					</div>
					
					
					
				</form>
				
				<div region="south" border="false" style="text-align:right;padding:5px 0;">
						<a id="btnSend_<?=$modul?>" class="easyui-linkbutton l-btn" iconcls="disk" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text disk" style="padding-left: 20px;"><? if($sts=='add'){?>Simpan<? }else{?>Update<? }?></span>
							</span>
						</a>
						<a id="btnBatal_<?=$modul?>" class="easyui-linkbutton l-btn" onclick="$('#isi_na_<?=$modul?>').css('display','inline');
								$('#form_naa_<?=$modul?>').css('display','none');" iconcls="cancel" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text cancel" style="padding-left: 20px;">Batal</span>
							</span>
						</a>
					</div>
	<?}?>
	<?
	if($modul=='penerimaan'){
	?>
		<form  method="post" id="<?=$modul?>_form"  enctype="multipart/form-data" 
			url="<?=base_url()?>procurement/simpan/tbl_penerimaan_barang">
					<input type='hidden' name='sts' value="<?=$sts?>" >
					<input type='hidden' name='id' value="<?=($sts=='edit' ? $data_header->id : '')?>" >
					<input type='hidden' name='id_detil_penerimaan' value="<?=($sts=='edit' ? $data_header->id_detil_penerimaan : '')?>" >
					<input type='hidden' name='flag_div' value="<?=$flag_div?>" >
					<fieldset>
						<legend>Receive Goods</legend>
						<table width="100%" border="0">
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Penerimaan Barang</span></td>
							<td width="2%">:</td>
							<td width="28%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;"><span id="no_penerimaan_na"><b><?=($sts=='edit' ? $data_header->no_penerimaan : $no_penerimaan)?></b></span>
							  <input type='hidden' name='no_penerimaan' id="no_penerimaan" style="width:200px;" value="<?=($sts=='edit' ? $data_header->no_penerimaan : $no_penerimaan)?>">
							</span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Faktur</span></td>
						    <td width="2%">:</td>
						    <td width="22%">
								<? if($sts!='edit') {?>
								<input type="text" readonly id="no_faktur_<?=$modul?>" value="<?=($sts=='edit' ? $data_header->no_faktur : '')?>" class="easyui-validatebox" />&nbsp;
								<a id="get_no_faktur_<?=$modul?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>									</span>								</a>
							<input type='hidden' id='tbl_faktur_pembelian_id_<?=$modul?>' name='tbl_faktur_pembelian_id' value="<?=($sts=='edit' ? $data_header->tbl_faktur_pembelian_id : '')?>">		&nbsp;
								<? }else{?>
								<input type='hidden' id='tbl_faktur_pembelian_id_<?=$modul?>' name='tbl_faktur_pembelian_id' value="<?=$data_header->tbl_faktur_pembelian_id?>"> <?=$data_header->no_faktur_pembelian?>
								<? }?>
							</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Penerimaan</span></td>
							<td width="2%">:</td>
							<td width="28%"><input type="hidden" name="tgl_penerimaan"  value="<?=($sts=='edit' ? $data_header->tgl_penerimaan : date('Y-m-d'))?>"/>
							<?=($sts=='edit' ? $data_header->tgl_penerimaan : date('Y-m-d'))?></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Faktur</span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="tgl_faktur_<?=$modul?>"><?=($sts=='edit' ? $data_header->tgl_permintaan : '')?></span>&nbsp;</td>
					      </tr>
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Group Dealer</span></td>
							<td width="2%">:</td>
							<td width="28%"><span id="group_<?=$modul?>"><?=($sts=='edit' ? $data_header->nama_group_dealer : '')?></span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Gudang</span></td>
						    <td width="2%">:</td>
						    <td width="22%">
								<select id="tbl_master_gudang_id" name="tbl_master_gudang_id" style="width:150px; border: 1px solid silver; padding: 1px;" class="easyui-validatebox">
									<option value="">-- Pilih --</option>
									<? foreach($gudang as $v ){?>
									<option value="<?=$v['id']?>" <? if($sts=='edit'){if($data_header->tbl_master_gudang_id==$v['id'])echo 'selected';}?>><?=$v['nama_gudang']?></option>
									<? }?>
								</select>
							</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Dealer</span></td>
							<td width="2%">:</td>
							<td width="28%"><span id="dealer_<?=$modul?>"><?=($sts=='edit' ? $data_header->nama_dealer : '')?></span></td>
						    <td width="23%"></td>
						    <td width="2%"></td>
						    <td width="22%">&nbsp;</td>
					      </tr>
						 
						</table>

					</fieldset>
					
					<div id="detil_na_coy" style="overflow:auto; ">
						<fieldset>
							<legend>Data Pengiriman Barang</legend>
								<table width="100%" border="0">
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Surat Jalan  </span></td>
							<td width="2%">:</td>
							<td width="28%"><input type="text" name="no_surat_jalan" id="no_surat_jalan" value="<?=($sts=='edit' ? $data_header->no_surat_jalan : '')?>" style="width:150px; border: 1px solid silver; padding: 1px;" class="easyui-validatebox" /></td>
						    <td width="23%">Diterima Oleh </td>
						    <td width="2%">:&nbsp;</td>
						    <td width="22%"><input type="text" name="diterima_oleh" id="diterima_oleh" value="<?=($sts=='edit' ? $data_header->diterima_oleh : '')?>" style="width:150px; border: 1px solid silver; padding: 1px;" class="easyui-validatebox" />&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl Surat Jalan  </span></td>
							<td width="2%">:</td>
							<td width="28%">
								<input type="text" name="tgl_surat_jalan" id="tgl_surat_jalan" value="<?=($sts=='edit' ? $data_header->tgl_surat_jalan : '')?>" /></td>
						    <td width="23%">
								<span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Total Truck & No Plat Armada </span>
							</td>
						    <td width="2%">:</td>
						    <td width="22%"><input type="text" name="total_truck" id="total_truck" value="<?=($sts=='edit' ? $data_header->total_truck : '')?>" style="width:40px; border: 1px solid silver; padding: 1px;" class="angka easyui-validatebox" />
							<input type="text" name="no_plat_armada" id="no_plat_armada" value="<?=($sts=='edit' ? $data_header->no_plat_armada : '')?>" style="width:100px; border: 1px solid silver; padding: 1px;"  />
							</td>
					      </tr>
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Keterangan</span></td>
							<td width="2%">:</td>
							<td width="28%"><textarea name="keterangan" id="keterangan" ><?=($sts=='edit' ? $data_header->keterangan : '')?></textarea>
								</td>
						    <td width="23%"></td>
						    <td width="2%"></td>
						    <td width="22%"></td>
						  </tr>
						</table>
						</fieldset>
						
						<fieldset>
						<legend>Data Barang	</legend>
						<div id="data_barangna">
						
						</div>
						
					</fieldset>
						
						
						
						
					
					</div>
					
					
					
				</form>
				
				<div region="south" border="false" style="text-align:right;padding:5px 0;">
						<a id="btnSend_<?=$modul?>" class="easyui-linkbutton l-btn" iconcls="disk" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text disk" style="padding-left: 20px;"><? if($sts=='add'){?>Simpan<? }else{?>Update<? }?></span>
							</span>
						</a>
						<a id="btnBatal_<?=$modul?>" class="easyui-linkbutton l-btn" onclick="$('#isi_na_<?=$modul?>').css('display','inline');
								$('#form_naa_<?=$modul?>').css('display','none');" iconcls="cancel" plain="true" href="#">
							<span class="l-btn-left">
								<span class="l-btn-text cancel" style="padding-left: 20px;">Batal</span>
							</span>
						</a>
					</div>
	<? }?>
	
	<? 
	if($modul=='retur'){
	?>
		<form  method="post" id="<?=$modul?>_form"  enctype="multipart/form-data" 
			url="<?=base_url()?>procurement/simpan/tbl_retur_pembelian">
					<input type='hidden' name='sts' value="<?=$sts?>" >
					<input type='hidden' name='id' value="<?=($sts=='edit' ? $data_header->id : '')?>" >
				
					<input type='hidden' name='flag_div' value="<?=$flag_div?>" >
					<fieldset>
						<legend>Retur Barang</legend>
						<table width="100%" border="0">
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">No Retur Pembelian </span></td>
							<td width="2%">:</td>
							<td width="28%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
							  <input type='hidden'  name='no_retur' id="no_retur" style="width:200px;" value="<?=$no_retur?>"><span id="retur_na"><?=$no_retur?></span>
							</span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Gudang</span></td>
						    <td width="2%">:</td>
						    <td width="22%">
								<input type="hidden" name="tbl_penerimaan_barang_id" id="tbl_penerimaan_barang_id" value="">
								<span id="gudang_na"></span>								
							</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Retur</span></td>
							<td width="2%">:</td>
							<td width="28%"><input type="hidden" name="tgl_retur"  value="<?=($sts=='edit' ? $data_header->tgl_retur : date('Y-m-d'))?>"/>
							<?=($sts=='edit' ? $data_header->tgl_retur : date('Y-m-d'))?></td>
						    <td width="23%">No Faktur Pembelian </td>
						    <td width="2%">:</td>
						    <td width="22%"><input type="text" readonly id="no_faktur_<?=$modul?>" value="<?=($sts=='edit' ? $data_header->no_faktur_pembelian : '')?>" />&nbsp;
								<a id="get_no_faktur_<?=$modul?>" class="l-btn l-btn-plain" href="#">
									<span class="l-btn-left">
										<span class="l-btn-text icon-search" style="padding-left: 20px;">&nbsp;</span>									</span>								</a>
							<input type='hidden' id='tbl_faktur_pembelian_id_<?=$modul?>' name='tbl_faktur_pembelian_id' value="<?=($sts=='edit' ? $data_header->tbl_faktur_pembelian_id : '')?>">	&nbsp;</td>
					      </tr>
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Group Dealer</span></td>
							<td width="2%">:</td>
							<td width="28%">
								<span id="group_<?=$modul?>"></span>
							</td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Tgl. Faktur</span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="tgl_faktur_<?=$modul?>"><?=($sts=='edit' ? $data_header->tgl_faktur : '')?></span>&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Dealer</span></td>
							<td width="2%">:</td>
							<td width="28%">
								<span id="dealer_<?=$modul?>"></span>
							</td>
						    <td width="23%">&nbsp;</td>
						    <td width="2%">&nbsp;</td>
						    <td width="22%">&nbsp;</td>
					      </tr>
						</table>

					</fieldset>
					
					<div id="detil_na_coy" style="overflow:auto; ">
						<fieldset>
							<legend>Supplier</legend>
								<table width="100%" border="0">
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Supplier</span></td>
							<td width="2%">:</td>
							<td width="28%">
								<span id="supplier_<?=$modul?>"></span>
							</td>
						    <td width="23%">&nbsp;</td>
						    <td width="2%">&nbsp;</td>
						    <td width="22%">&nbsp;</td>
						  </tr>
						   <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Kota </span></td>
							<td width="2%">:</td>
							<td width="28%"><span id="kota_<?=$modul?>"><?=($sts=='edit' ? $data_header->kota : '')?></span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Telp </span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="telp_<?=$modul?>"><?=($sts=='edit' ? $data_header->telp : '')?></span>&nbsp;</td>
					      </tr>
						  <tr>
							<td width="0%">&nbsp;</td>
							<td width="23%"><span class="style1">Alamat</span></td>
							<td width="2%">:</td>
							<td width="28%"><span id="alamat_<?=$modul?>"><?=($sts=='edit' ? $data_header->alamat : '')?></span></td>
						    <td width="23%"><span style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Email</span></td>
						    <td width="2%">:</td>
						    <td width="22%"><span id="email_<?=$modul?>"><?=($sts=='edit' ? $data_header->email : '')?></span>&nbsp;</td>
						  </tr>
						</table>
						</fieldset>
						
						<fieldset>
						<legend>Data Barang	</legend>
						<table width="100%"  cellpadding="0" cellspacing="2">
							 <tr>
								<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">&nbsp;</td>
								<td width="24%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Grand Total</td>
								<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">:</td>
								<td width="72%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
									Rp. <span id="grand_total_<?=$modul?>"><?=($sts=='edit' ? $data_header->tot_nilai_faktur : '')?></span></td>
							  </tr>
							  <tr>
								<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">&nbsp;</td>
								<td width="24%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">Kondisi Retur</td>
								<td width="2%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">:</td>
								<td width="72%"  style="vertical-align: top; font-family: inherit; padding-bottom: 5px;">
									<input type="text" name="kondisi_retur" value="" style="width:250px;"></td>
							  </tr>
						</table>
						<br />
						<div id="data_barangna_<?=$modul?>">
						
						</div>

						
						</fieldset>
						
						
						
						
					
					</div>
					
					
					
				</form>
				
				<div region="south" border="false" style="text-align:right;padding:5px 0;">
					<a id="btnSend_<?=$modul?>" href="#"></a>
					<a id="btnBatal_<?=$modul?>" href="#"></a>
				</div>
	<? }?>
	
	
	</div>
	
</div>


<script>
	var modul = "<?=$modul?>";
	var flag_div = "<?=$flag_div?>";
	var sts='<?=$sts?>';
	var idx=<?=($sts=='edit' ? $jml_detil : 0)?>;
	var no_penerimaan
	var no_pemesanan
	
	$('#btnSend_<?=$modul?>').linkbutton({
		iconCls: 'disk',
		text:<? if($sts=='add'){?>'Simpan'<? }else{?>'Update'<? }?>
	});
	$('#btnBatal_<?=$modul?>').linkbutton({
		iconCls: 'cancel',
		text:'Batal'
	});
	
	$(".easyui-validatebox").validatebox({required:true}); 
	
	if (modul=='penerimaan'){
		no_penerimaan='<?=($sts=='edit' ? $data_header->no_pemesanan : '')?>';
		no_pemesanan='<?=($sts=='edit' ? $data_header->no_pemesanan : '')?>';
	}
	$('#tab_detail').tabs({
				height: frmHeight-217,
				width: frmWidth-293,
				plain: false
	});
	
	$('#detil_na_coy').css('height',frmHeight-400);
	
	
	
	
</script>
<script type="text/javascript" src="<?=base_url()?>assets/js/procurement/form.js"></script>